const express = require("express");
const Fs = require("fs");
require("./socket");

const app = express();

Fs.readdir(".", (err, files) => {
    // 静态资源文件夹不存在时自动创建
    if (!files.includes("public")) {
        Fs.mkdir("public", () => {
            console.log("Created public folder");
        });
    }
})

// 静态路由
app.use("/update", express.static('public'));

app.listen(10209, () => {
    console.log("Server is running on port 10209");
})